home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7940 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: pegasus.montclair.edu!triant
  2. From: triant@pegasus.montclair.edu (Constantine Triantafillou)
  3. Newsgroups: comp.lang.c
  4. Subject: Heeelp: Interfacing Pascal object code with C. How?
  5. Date: 27 Feb 1996 14:33:00 -0500
  6. Organization: Montclair State University
  7. Message-ID: <triant.825447166@pegasus.montclair.edu>
  8. NNTP-Posting-Host: pegasus.montclair.edu
  9. Keywords: 1
  10. X-Newsreader: NN version 6.5.0 #68 (NOV)
  11.  
  12. Hi!
  13.  
  14. I am doing a programming project, developing a very simple imaginery 
  15. assembler:
  16.  
  17. However I have the following problem.
  18.  
  19. I am trying to find out how can I interface an object file
  20. with a C program. Note that the object file is generated
  21. by a Pascal compiler, and it should be called by  modules
  22. in a C program. The object file creates, initializes and writes into
  23. a hash table which !!*should not be erased*!! after the object file has
  24. finished execution. That is the hash table should be "global". 
  25.  
  26. The C modules should be able to pass arguments to that object file!
  27.  
  28. I've never done this before so I need help.
  29. The Pascal code (and thus the object file) that generates the hash table is 
  30. by itself a complete program with its own modules. 
  31. Only the object file knows about the hash table. Not the C modules.
  32.  
  33. Arguments that should be passed to the object file by a C function (module):
  34.  
  35. int Location_Counter, (Input parameter) char Label, (Input parameter)
  36. int *flag_pointer (Output parameter)      
  37.  
  38. Do I have to generate an assembler version of the Pascal program, then
  39. edit it to make it capable of accepting arguments, and be able to
  40. access the hash table without destroyng it after finishing its execution!
  41. How I do that. In my school we use SUN cc, gcc, and pc compilers. 
  42. Please send me E-mail.
  43.  
  44. Thank You A Million!
  45.  
  46. Constantine Triantafillou (novice programmer)
  47.